<template>
    <div class="container container-resourceDetail">
        <a-spin tip="Loading..." :spinning="loading">
            <div class="page-top">
                <img class="page-top-bg" :src="require('@/assets/img/resource-bg.png')" />
                <div class="page-top-panel">
                    <div class="page-top-title">专业的科技成果转移转化解决方案提供商</div>
                    <div class="page-top-tips">解决成果转移转化问题</div>
                </div>
            </div>
            <div class="info-top">
                <div class="info-row word-title">{{detailInfo.name}}</div>
            </div>
            <div class="page-panell">
                <div class="panel-title">
                    <div class="panel-content">资源介绍</div>
                </div>
                <div class="panel-content word-content">
                    <div v-html="detailInfo.introduce"></div>
                </div>
            </div>
            <div class="page-panell">
                <div class="panel-title">
                    <div class="panel-content">联系部门</div>
                </div>
                <div class="panel-content word-content">
                    <div class="content-list">{{detailInfo.relationDepartment}}</div>
                </div>
            </div>
            <div class="page-panell">
                <div class="panel-title">
                    <div class="panel-content">联系方式</div>
                </div>
                <div class="panel-content word-content">
                    <div class="content-list">{{detailInfo.contactWay}}</div>
                </div>
            </div>
            <div class="page-panell">
                <div class="panel-title">
                    <div class="panel-content">相关链接</div>
                </div>
                <div class="panel-content word-content">
                    <div class="content-list">{{detailInfo.url}}</div>
                </div>
            </div>
            
        </a-spin>
    </div>
</template>

<script lang="ts">
import { Vue, Component } from "vue-property-decorator";
import api from "@/api/api";
import { getStorageUserInfo } from "@/utils";
@Component({
    name: "dom",
    components: {},
})
export default class index extends Vue {
    detailInfo = {};
    pageId = "";
    loading = false;
    mounted() {
        const query = this.$route.query;
        this.pageId = query.id ? query.id + "" : "";
        this.getDetail();
    }
    async getDetail() {
        this.loading = true;
        try {
            const res = await api.findResourceAbutment({
                id: this.pageId,
            });
            this.detailInfo = res.data;
        } finally {
            this.loading = false;
        }
    }
    splitContent(str: string) {
        return str.slice(0, 65) + "...";
    }
}
</script>

<style lang="scss">
.container-resourceDetail {
    .page-top {
        position: relative;
    }
    .page-top-bg {
        width: 100%;
    }
    .page-top-panel {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
    }
    .page-top-title {
        font-weight: bold;
        font-size: 45px;
        color: #132042;
    }
    .page-top-tips {
        font-size: 30px;
        color: #132042;
    }

    .panel-content {
        width: 1350px;
        margin: 0 auto;
    }
    .panel-title {
        font-weight: bold;
        font-size: 22px;
        color: #2f65f3;
        background-color: #fff;

        .panel-content {
            height: 40px;
            display: flex;
            align-items: center;
        }
        .panel-content::before {
            content: "";
            display: inline-block;
            height: 26px;
            width: 1px;
            border-right: 3px solid #2f65f3;
            margin-right: 20px;
        }
    }

    .word-title {
        font-size: 32px;
        font-weight: bold;
        text-align: center;
    }
    .word-content {
        padding: 20px 15px;
    }

    .content-list {
        font-size: 16px;
        color: #2d2d2d;
        line-height: 30px;
        position: relative;
    }
    .content-list::before {
        content: "";
        display: inline-block;
        width: 6px;
        height: 6px;
        border-radius: 8px;
        background-color: #2f65f3;
        position: absolute;
        left: -15px;
        top: 12px;
    }
    .info-top{
        padding-top: 80px;
        padding-bottom: 40px;
    }
}
</style>
